<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        *{
            margin: 0;
            padding: 0;
        }

        img{
            display: block;
        }

        .box{
            width: 350px;
            margin: 100px auto;
            border: 3px solid rebeccapurple;
            position: relative;
            overflow: hidden;
        }

        .box .pic{
            width: 100%;
        }
        .box:hover .pic{
            transform: translateY(-20px);
        }
        img,p,h2{
            transition: all 1s;
        }

        .box h2{
            position: absolute;
            left: 60px;
            top: 10px;
            color: white;
            transform: translateY(-100px);
        }

        .box:hover h2{
            transform: translateY(0px);
        }

        .box p{
            position: absolute;
            bottom: 0;
            padding: 20px;
            left: 20px;
            transform: translateY(30px);
            opacity: 0;
        }

        .box:hover p{
            transform: translateY(-30px);
            opacity: 1;
        }

        .box .icon{
            position: absolute;
            right: 10px;
            top: 10px;
            height: 40px;
            width: 40px;
            animation: 20;
            animation: czhicon 1s linear infinite;
        }


        /* .box:hover .icon{
            transform: rotate(360deg);
        } */
        /* 声明动画 */
        @keyframes czhicon {
            from{
                transform: rotate(0deg);
            }
            to{
                transform: rotate(360deg);
            }
            
        }

    </style>

</head>

<body>
    <div class="box">
        <img src="./image/1.webp" alt="" class="pic">
        <div>
            <h2>title</h2>
            <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Sapiente quia sequi quam expedita corrupti
                repellendus debitis quaerat assumenda, recusandae sint adipisci, ducimus illo rerum quibusdam cupiditate
                nisi nulla nihil nobis.</p>

                <img src="./image/icon.png" alt="" class="icon">
        </div>

    </div>
</body>

</html>